package main

import "fmt"

type person struct {
	first string
	last  string
	age   int
}

//递归结构体
type node struct {
	data    float64
	su      *node
}

func main() {
	p1 := person{"James", "Bond", 20}
	fmt.Println(p1.first, p1.last, p1.age)

	p2 := new(person)
	p2.first = "张"
	p2.last = "三"
	fmt.Println(p2.first, p2.last, p2.age)

	//递归
	p3 := new(node)
	p3.data = 11.22
	p3.su = p3
	fmt.Println(p3.su.su.su.su.data)
}
